package com.wonder.app.service;

import cn.hutool.core.io.watch.WatchException;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.vtuzx.core.utils.VtuzxUtil;
import com.wonder.app.domain.*;
import com.wonder.app.request.AgentManageRequest;
import com.wonder.app.request.SfcOperpRequest;
import com.wonder.app.request.SfcOptrptRequest;
import com.wonder.app.vo.AgentManageVo;
import com.wonder.common.common.AjaxResult;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

public interface SfcOptrptService extends IService<SfcOptrpt>{

    /**
     * 工序汇报分页
     * @param sfcOptrptRequest
     * @param page
     * @return
     */
    public  IPage<SfcOptrpt> selectList(SfcOptrptRequest sfcOptrptRequest, Page<SfcOptrpt> page);
    /**
     * 详情Stkotherout
     * @param map
     * @return
     */
    Map<String, Object> getSfcOptrptDetail(Map<String, Object> map);
    Map<String, Object> getOptrptisDetail(Map<String, Object> map);

    boolean createReport(Map<String,Object> map,String username,Long user_id) throws Exception;


    boolean auditReport(Map<String, Object> map, String userName,Long user_id) throws Exception;

    Map<String, Object> getReportByOperNo(Map<String, Object> map, String userName) throws Exception;

    Boolean createReportPackage(Map<String, Object> map, String userName)throws Exception;

    IPage<SfcOptrpt> packageList(SfcOptrptRequest sfcOptrptRequest, Page<SfcOptrpt> page);

    Boolean auditReportPackage(Map<String, Object> map, String userName,Long user_id)throws Exception;

    boolean createReportJijia(Map<String, Object> map, String userName, Long user_id) throws Exception;

    /**
     * 查询之前汇报的完工数量总和,合格数量总和
     * @param operNo
     * @param trayNo
     * @return
     */
    public Map<String,Object> optrptCount(Integer operNo,String trayNo);

    /**
     * 查询已经汇报过的所有料废数量总和
     * @param operNo
     * @param trayNo
     * @return
     */
    public Double getFailCount(Integer operNo,String trayNo);

    Map<String, Object> getOptrptByTray(Map<String, Object> map, String userName, Long user_id) throws Exception;

    Boolean updateOprptDetail(Map<String, Object> map, String userName, Long user_id) throws Exception;
}
